bitkeeper revision 1.1159.1.3 (41139174iXDl-lRZjxOIIxORO_R1YA)
authorcl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Fri, 6 Aug 2004 14:11:00 +0000 (14:11 +0000)
committercl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk>
Fri, 6 Aug 2004 14:11:00 +0000 (14:11 +0000)
Only fail because we're not a privileged domain after performing all
other checks (permissions & valid level).

linux-2.6.7-xen-sparse/arch/xen/i386/kernel/ioport.c

index 13b1cfffc2578c6f28ace36905b8c841774357f7..6cbd6c9336d2875ed18b553269775b7bc0508caa 100644 (file)
@@ -15,9 +15,6 @@ asmlinkage long sys_iopl(unsigned int new_io_pl)
        unsigned int old_io_pl = current->thread.io_pl;
        dom0_op_t op;
 
-       if (!(start_info.flags & SIF_PRIVILEGED))
-               return -EPERM;
-
        if (new_io_pl > 3)
                return -EINVAL;
 
@@ -25,6 +22,9 @@ asmlinkage long sys_iopl(unsigned int new_io_pl)
        if ((new_io_pl > old_io_pl) && !capable(CAP_SYS_RAWIO))
                return -EPERM;
 
+       if (!(start_info.flags & SIF_PRIVILEGED))
+               return -EPERM;
+
        /* Maintain OS privileges even if user attempts to relinquish them. */
        if (new_io_pl == 0)
                new_io_pl = 1;